package com.hey.snmp.server;

import com.hey.mib.entity.BaseInterface;
import com.hey.snmp.utils.SNMPTarget;

import java.rmi.Remote;
import java.util.List;

public abstract interface SNMPAPI extends Remote {



  /**
   * 检测设备snmp是否连通
   * @param target
   * @throws Exception
   */
  public abstract void checkSnmpAgentActive(SNMPTarget target) throws Exception;

  /**
   * 获取一个String类型的值，调用SNMP.get方法
   * @param paramOid
   * @param target
   * @return
   * @throws Exception
   */
  public abstract String getOIDValue(SNMPTarget target,String paramOid) throws Exception;

  /**
   * 获取一个Long类型的值，调用SNMP.get方法
   * @param paramOid
   * @param target
   * @return
   * @throws Exception
   */
  public abstract long getOIDLongValue(SNMPTarget target,String paramOid) throws Exception;

  /**
   * 获取一个String类型的值，调用SNMP.getNext方法
   * @param paramOid
   * @param target
   * @return
   * @throws Exception
   */
  public abstract String getNextOIDValue(SNMPTarget target,String paramOid) throws Exception;

  /**
   * 获取一个Object(对应类的一组数据)
   * @param target
   * @param paramObj
   * @return
   * @throws Exception
   */
  public abstract Object getObject(SNMPTarget target,BaseInterface paramObj,Boolean syn) throws Exception;

  /**
   * 获取一个List（对应类下面的所有数据）,无索引
   * @param target
   * @param paramClass 与MIB文件对应的JAVA类名
   * @return
   * @throws Exception
   */
  public abstract List getAllTableData(SNMPTarget target,BaseInterface paramClass) throws Exception;

  /**
   * 根据OID更改对象的值
   * @param target
   * @param goalOid 目标OID
   * @param goalIndex 目标索引
   * @param goalVal 设置的值
   * @throws Exception
   */
  public abstract void setOIDValue(SNMPTarget target,String goalOid, String goalIndex, Object goalVal) throws Exception;

  /**
   * 根据Object更新一个对象
   * @param paramObject
   * @param target
   * @throws Exception
   */
  public abstract void updateObject(SNMPTarget target,BaseInterface paramObject) throws Exception;

  /**
   * 修改Object更新一个对应，带MIB参数节点名称
   * @param target
   * @param paramObj
   * @param paramList
   * @throws Exception
   */
  public abstract void updateParam(SNMPTarget target,BaseInterface paramObj,List<String> paramList) throws Exception;

  /**
   * 添加一条数据
   * @param target
   * @param paramObj
   * @throws Exception
   */
  public abstract void addTableRow(SNMPTarget target,BaseInterface paramObj) throws Exception;

  /**
   * 删除一条数据
   * @param target
   * @param paramObj
   * @throws Exception
   */
  public abstract void delTableRow(SNMPTarget target,BaseInterface paramObj) throws Exception;
}
